<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>客户端1</title>

    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <script src="https://cdn.bootcss.com/ace/1.4.3/ace.js"></script>
    <script src="https://cdn.bootcss.com/ace/1.4.3/ext-language_tools.js"></script>

    <style>
        .mt_4 {
            margin-top: 4px;
        }

        .mt_10 {
            margin-top: 10px;
        }

        #btn_send {
            width: 80px;
        }

        body,
        html {
            width: 1220px;
            margin: 0 auto;
            padding: 0;
            height: 100%;
            overflow: hidden;
        }


        #editor {
            width: 600px;
            height: 600px;
            overflow: hidden;
            line-height: 20px;
        }

        #editor2 {
            width: 600px;
            height: 600px;
            overflow: hidden;
            line-height: 20px;
        }



        .container {
            width: 570px;
            padding: 0;
        }

        .panel-body {
            padding: 0;
            overflow: hidden;
        }


        .panel-default {
            border-color: #272822;
        }


        .request_respone_panel_container {}

        .request_respone_panel_container .panel {
            width: 600px;
        }

        .fl {
            float: left;
        }

        .fr {
            float: right;
        }
    </style>
</head>

<body>



    <div class="request_respone_panel_container">
        <div class="panel panel-default mt_10 fl">
            <div class="panel-heading">请求参数</div>
            <div class="panel-body">
                <div id="content">
                    <div id="editor" class=""></div>
                </div>
            </div>
            <div class="panel-footer">
                <div class="container" id="app">
                    <select v-model="WebToNativeKey" class="form-control">
                        <option v-for="item in SocketServerConfig.WebToNativeKeyArr">{{item}}</option>
                    </select>

                    <button type="button" @click="send" class="btn btn-success btn-block  mt_10">发送</button>

                </div>
            </div>
        </div>

        <div class="panel panel-default mt_10 fr">
            <div class="panel-heading">返回参数</div>
            <div class="panel-body">
                <div id="content">
                    <div id="editor2" class=""></div>
                </div>
            </div>
        </div>
    </div>


    <script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>

    <script type="text/javascript">


        var editor = ace.edit("editor", {
            theme: "ace/theme/monokai",
            mode: "ace/mode/java",
            autoScrollEditorIntoView: true,
            enableBasicAutocompletion: true,
            enableSnippets: true,
            enableLiveAutocompletion: true
        });
        editor.setShowPrintMargin(false);
        editor.setOption("wrap", "free")

        editor.getSession().on('change', function (e) {
            // e.type, etc
        });

        var innerCode=`package com.andrew.demo.mapper;

import com.andrew.demo.model.User;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;

public class UserMapper implements RowMapper<User> {

    public static final String SELECT_SQL = "select * from User";

    public static final String UPDATE_SQL = "update User set (name,age,sex) values (:name,:age,:sex)";

    @Override
    public User mapRow(ResultSet rs, int rowNum) throws SQLException {
        Integer id = rs.getInt("id");
        String name = rs.getString("name");
        Integer age = rs.getInt("age");
        String sex = rs.getString("sex");
        return new User(id, name, age, sex);
    }

}`;

        editor.session.setValue(innerCode);

        

    </script>

</body>

</html>